home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / toolbar / spltrcls / hsplittr.frm < prev    next >
Text File  |  1995-11-14  |  4KB  |  136 lines

  1. VERSION 4.00
  2. Begin VB.Form frmHSplitter 
  3.    Caption         =   "Horizontal Splitter Test"
  4.    ClientHeight    =   2865
  5.    ClientLeft      =   1260
  6.    ClientTop       =   4800
  7.    ClientWidth     =   5595
  8.    Height          =   3270
  9.    Left            =   1200
  10.    LinkTopic       =   "Form1"
  11.    LockControls    =   -1  'True
  12.    ScaleHeight     =   2865
  13.    ScaleWidth      =   5595
  14.    Top             =   4455
  15.    Width           =   5715
  16.    Begin VB.PictureBox picHContainer 
  17.       Appearance      =   0  'Flat
  18.       BackColor       =   &H00C0C0C0&
  19.       BorderStyle     =   0  'None
  20.       ForeColor       =   &H80000008&
  21.       Height          =   2640
  22.       Left            =   105
  23.       ScaleHeight     =   2640
  24.       ScaleWidth      =   5370
  25.       TabIndex        =   0
  26.       Top             =   105
  27.       Width           =   5370
  28.       Begin VB.TextBox txtBottom 
  29.          ForeColor       =   &H00000000&
  30.          Height          =   1170
  31.          Left            =   105
  32.          MultiLine       =   -1  'True
  33.          ScrollBars      =   2  'Vertical
  34.          TabIndex        =   3
  35.          Text            =   "HSplittr.frx":0000
  36.          Top             =   1365
  37.          Width           =   5160
  38.       End
  39.       Begin VB.TextBox txtTop 
  40.          ForeColor       =   &H00000000&
  41.          Height          =   1170
  42.          Left            =   105
  43.          MultiLine       =   -1  'True
  44.          ScrollBars      =   2  'Vertical
  45.          TabIndex        =   2
  46.          Text            =   "HSplittr.frx":00C2
  47.          Top             =   105
  48.          Width           =   5160
  49.       End
  50.       Begin VB.PictureBox picHSplitter 
  51.          BackColor       =   &H00C0C0C0&
  52.          BorderStyle     =   0  'None
  53.          DrawMode        =   1  'Blackness
  54.          DrawStyle       =   5  'Transparent
  55.          Height          =   45
  56.          Left            =   105
  57.          MouseIcon       =   "HSplittr.frx":0181
  58.          MousePointer    =   99  'Custom
  59.          ScaleHeight     =   45
  60.          ScaleWidth      =   5265
  61.          TabIndex        =   1
  62.          Top             =   1260
  63.          Width           =   5265
  64.       End
  65.    End
  66. End
  67. Attribute VB_Name = "frmHSplitter"
  68. Attribute VB_Creatable = False
  69. Attribute VB_Exposed = False
  70. Option Explicit
  71.  
  72. ' form position constants
  73. Const FORM_LEFT = 360
  74. Const FORM_TOP = 360
  75.  
  76. ' splitter position and offsets
  77. Const SPLITTER_LEFT = 105
  78. Const SPLITTER_TOP = 105
  79. Const SPLITTER_WIDTH_OFFSET = 315
  80. Const SPLITTER_HEIGHT_OFFSET = 600
  81.  
  82. ' splitter object
  83. Dim moHSplitter As CHorizontalSplitter
  84.  
  85. Private Sub Form_Load()
  86.  
  87.    ' position
  88.    Me.Move FORM_LEFT, FORM_TOP
  89.    
  90.    ' instantiate the splitter object
  91.    Set moHSplitter = New CHorizontalSplitter
  92.    moHSplitter.Init picHContainer, picHSplitter, _
  93.       txtTop, txtBottom
  94.  
  95. End Sub
  96.  
  97. Private Sub Form_Resize()
  98.  
  99.    ' resize the container
  100.    If Me.WindowState <> vbMinimized Then
  101.       moHSplitter.Move SPLITTER_LEFT, _
  102.          SPLITTER_TOP, _
  103.          Me.Width - SPLITTER_WIDTH_OFFSET, _
  104.          Me.Height - SPLITTER_HEIGHT_OFFSET
  105.    End If
  106.    
  107. End Sub
  108.  
  109. Private Sub Form_Unload(Cancel As Integer)
  110.    
  111.    ' release the splitter object
  112.    Set moHSplitter = Nothing
  113.    
  114. End Sub
  115.  
  116. Private Sub picHSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  117.    
  118.    ' record event
  119.    moHSplitter.MouseDown
  120.    
  121. End Sub
  122.  
  123. Private Sub picHSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  124.    
  125.    ' record event
  126.    moHSplitter.MouseMove Y
  127.  
  128. End Sub
  129.  
  130. Private Sub picHSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  131.    
  132.    ' record event
  133.    moHSplitter.MouseUp
  134.  
  135. End Sub
  136.